package com.smz.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smz.entity.TPrinter;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Kan
 * @Time 2021-11-21-18:34
 */
public interface TPrinterDAO extends BaseMapper<TPrinter> {

    //查询所有打印机的生产产线
    @Select("select print.*,line.production_name from t_printer print left join" +
            " t_production_line line on print.p_line=line.id")
    List<TPrinter> findAllPrinters();

    //查询一个打印机的生产产线
    @Select("select print.*,line.production_name from t_printer print left join" +
            " t_production_line line on print.p_line=line.id where p_num like CONCAT(#{pNum},'%')")
    List<TPrinter> findPrinter(String pNum);
}
